<%--
  Created by IntelliJ IDEA.
  User: 联想
  Date: 2020/2/21
  Time: 19:38
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>Layui</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/resources/layui/css/layui.css" media="all">
    <!-- 注意：如果你直接复制所有代码到本地，上述css路径需要改成你本地的 -->

</head>
<body>
<blockquote class="layui-elem-quote layui-text">
    信息展示
    <span style="color: green">${rightImproveMsg}</span>
    <span style="color: red">${errorImproveMsg}</span>
</blockquote>
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
    <legend>完善您的个人信息</legend>
</fieldset>
<form class="layui-form" action="${pageContext.request.contextPath}/teacher/Improve" method="get">

    <input name="teacherNo" value="${teacher.getTeacherNo()}" type="hidden">
    <input name="teacherName" value="${teacher.getTeacherName()}" type="hidden">
    <input name="teacherPwd" value="${teacher.getTeacherPwd()}" type="hidden">

    <div class="layui-form-item">
        <label class="layui-form-label">性别</label>
        <div class="layui-input-block">
            <input type="radio" name="teacherSex" value="男" title="男" checked="">
            <input type="radio" name="teacherSex" value="女" title="女">
        </div>
    </div>

    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">出生日期</label>
            <div class="layui-input-inline">
                <input type="text" name="teacherBirth" value="${teacher.getTeacherBirth()}" id="date" lay-verify="date" placeholder="yyyy-MM-dd"
                       autocomplete="off" class="layui-input">
            </div>
        </div>

        <div class="layui-inline">
            <label class="layui-form-label">学院</label>
            <div class="layui-input-inline">
                <input type="text" name="teacherDepartment" value="${teacher.getTeacherDepartment()}" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">电话</label>
            <div class="layui-input-inline">
                <input type="tel" name="teacherTell" value="${teacher.getTeacherTell()}" class="layui-input">
            </div>
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">籍贯</label>
        <div class="layui-input-block">
            <input type="text" name="teacherAddress" value="${teacher.getTeacherAddress()}" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item">
        <div class="layui-input-block">
            <button type="submit" class="layui-btn" lay-submit="" lay-filter="demo1">立即提交</button>
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
    </div>

</form>
<script src="${pageContext.request.contextPath}/resources/layui/layui.js" charset="utf-8"></script>

<script>
    layui.use(['form', 'layedit', 'laydate'], function(){
        var form = layui.form
            ,layer = layui.layer
            ,layedit = layui.layedit
            ,laydate = layui.laydate;

        //日期
        laydate.render({
            elem: '#date'
        });
        laydate.render({
            elem: '#date1'
        });

    });
</script>

<blockquote class="layui-elem-quote layui-text">
    信息展示
</blockquote>
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
    <legend>更换&添加头像</legend>
</fieldset>
<div class="layui-upload">
    <blockquote class="layui-elem-quote layui-quote-nm" style="margin-top: 10px;">
        预览图：
        <img style="width: auto;height: auto;max-width: 25%;max-height: 25%" src="${userAvatar.getAvatar()}">
    </blockquote>
    <form id="upload01" name="upload01" enctype="multipart/form-data" method="post">
        <input type="hidden" name="fileType" value="AvatarPhoto">
        <input type="file" name="file"/>
        <button type="submit" class="layui-btn" onclick="formSubmit01()"><i class="layui-icon"></i>确定上传</button>
    </form>
    <script language="javascript">
        function formSubmit01() {
            var action = "${pageContext.request.contextPath}/teacher/uploadIdPhoto";
            action += "?fileType=" + document.upload01.fileType.value;
            document.upload01.action = action;
            document.upload01.submit();
        }
    </script>
</div>

<blockquote class="layui-elem-quote layui-text">
    信息展示
</blockquote>
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
    <legend>更换&添加证件照</legend>
</fieldset>
<div class="layui-upload">
    <blockquote class="layui-elem-quote layui-quote-nm" style="margin-top: 10px;">
        预览图：
        <img style="width: auto;height: auto;max-width: 25%;max-height: 25%" src="${userAvatar.getIDPhoto()}">
    </blockquote>
    <form id="upload" name="upload" enctype="multipart/form-data" method="post">
        <input type="hidden" name="fileType" value="IDPhoto">
        <input type="file" name="file"/>
        <button type="submit" class="layui-btn" onclick="formSubmit()"><i class="layui-icon"></i>确定上传</button>
    </form>
    <script language="javascript">
        function formSubmit() {
            var action = "${pageContext.request.contextPath}/teacher/uploadIdPhoto";
            action += "?fileType=" + document.upload.fileType.value;
            document.upload.action = action;
            document.upload.submit();
        }
    </script>
</div>

</body>
</html>
